﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;

namespace IHISCETeim.Web.MachineSys.MarketModel
{
    public partial class MAgentAddressEdit : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.修改 };
            }
        }
        protected override string DWZRef
        {
            get { return "AgentList"; }
        }

        protected int MAAID
        {
            get
            {
                return GetRequestValue<int>("MAAID", 0);
            }
        }

        protected MAgentAddressInfo _obj = null;
        protected MAgentAddressInfo obj
        {
            get
            {
                if (_obj == null)
                {
                    _obj = MAgentAddressController.GetById(MAAID);
                }
                return _obj;
            }
        }

        #region

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "edit")
            {
                addmenu();
            }
        }

        protected void addmenu()
        {
            MAgentAddressInfo obj2 = Request.SerializableObject<MAgentAddressInfo>();

            //  obj2.AddRealName = User.RealName;

            this.AddLog(Permission.修改, obj, obj2);
            if (MAgentAddressController.Update(obj2))
                SuccessJson("修改成功", "MAgentAddressList", "MarketModel/MAgentAddressList.aspx?CardCode=" + obj.CardCode);
            else
                ErrorJson("修改失败");
        }
    }
}